Index: README.txt =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/kiosk/README.txt,v retrieving revision 1.1 diff -u -p -r1.1 README.txt --- README.txt 19 Mar 2008 18:44:17 -0000 1.1 +++ README.txt 24 Jan 2010 22:59:21 -0000 @@ -18,12 +18,8 @@ or not. That may result in a delay befo INSTALLATION -In Drupal 5, an extra theme step is required for the kiosk module. After -installing the module normally, go to your theme and locate the -_phptemplate_variables() function in template.php. Add the following line -before the switch statement, so that it applies to all templates: - -$vars['kiosk'] = kiosk_is_kiosk(); +Upload and enable the kiosk module following the normal process for +contributed Drupal modules. The theme author can then put conditionals into the template like so: Index: kiosk.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/kiosk/kiosk.info,v retrieving revision 1.1 diff -u -p -r1.1 kiosk.info --- kiosk.info 19 Mar 2008 18:44:17 -0000 1.1 +++ kiosk.info 24 Jan 2010 22:59:21 -0000 @@ -1,3 +1,6 @@ ; $Id: kiosk.info,v 1.1 2008/03/19 18:44:17 crell Exp $ name = Kiosk description = Allow selected computers to be put into 'kiosk' mode. +version = "6.x-1.0" +project = "kiosk" +core = 6.x Index: kiosk.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/kiosk/kiosk.install,v retrieving revision 1.1 diff -u -p -r1.1 kiosk.install --- kiosk.install 19 Mar 2008 18:44:17 -0000 1.1 +++ kiosk.install 24 Jan 2010 22:59:21 -0000 @@ -1,6 +1,12 @@ 'admin/settings/kiosk', - 'title' => t('Kiosk mode'), - 'description' => t('Configure what clients will be considered "kisok mode".'), - 'callback' => 'drupal_get_form', - 'callback arguments' => array('kiosk_configure'), + + $items['admin/settings/kiosk'] = array( + 'title' => 'Kiosk mode', + 'description' => 'Configure what clients will be considered "kisok mode".', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('kiosk_configure'), 'type' => MENU_NORMAL_ITEM, - 'access' => user_access('administer kiosk settings'), + 'access arguments' => array('administer kiosk settings'), ); $items[] = array( - 'title' => t('By IP'), + 'title' => 'By IP', 'path' => 'admin/settings/kiosk/ip', 'type' => MENU_DEFAULT_LOCAL_TASK, - 'access' => user_access('administer kiosk settings'), + 'access arguments' => array('administer kiosk settings'), ); - $items[] = array( - 'path' => 'admin/settings/kiosk/cookie', - 'title' => t('Set computer'), - 'description' => t('Set a cookie on the current computer to force it into kiosk mode, regardless of IP address.'), - 'callback' => 'drupal_get_form', - 'callback arguments' => array('kiosk_configure_cookie'), + $items['admin/settings/kiosk/cookie'] = array( + 'title' => 'Set computer', + 'description' => 'Set a cookie on the current computer to force it into kiosk mode, regardless of IP address.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('kiosk_configure_cookie'), 'type' => MENU_LOCAL_TASK, - 'access' => user_access('administer kiosk settings'), + 'access arguments' => array('administer kiosk settings'), ); - } - else { - } return $items; } @@ -99,7 +95,7 @@ function kiosk_configure_cookie() { return $form; } -function kiosk_configure_cookie_submit($form_id, $form_values) { +function kiosk_configure_cookie_submit($form, &$form_state) { setcookie('drupal_kiosk_mode', 1, $expire, '/'); drupal_set_message(t('This computer has been set to kiosk mode. Clear your cookies in order to reset it.')); @@ -135,7 +131,7 @@ function kiosk_is_kiosk() { $ip_addresses = kiosk_parse_list_values(variable_get('kiosk_ip_addresses', '')); - return (in_array($_SERVER['REMOTE_ADDR'], $ip_addresses) || 1 == $_COOKIE['drupal_kiosk_mode']); + return (in_array(ip_address(), $ip_addresses) || 1 == $_COOKIE['drupal_kiosk_mode']); } /** @@ -148,3 +144,15 @@ function kiosk_parse_list_values($list) return array_filter(array_map('trim', explode(',', str_replace("\n", ',', $list)))); } + +/** + * Hook into the theme preprocess function and make the $kiosk variable available + * + */ +function kiosk_preprocess(){ + // This adds the variable $kiosk to the variables available to themers + $vars['kiosk'] = kiosk_is_kiosk(); +} + + +